package 左哥算法.ch10暴力递归;

import java.util.Scanner;

public class 汉诺塔问题 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        fun(sc.nextInt(),'A','C','B');
    }
    public static void fun(int n,char from,char to,char other){
        if (n==1){
            System.out.println("Move disk "+n+" from "+from+" to "+to);
            return;
        }
        fun(n-1,from,other,to);
        System.out.println("Move disk "+n+" from "+from+" to "+to);
        fun(n-1,other,to,from);
    }
}
